package com.czy.workflow.core.model;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 流程分支
 */
@Entity
@Table(name = "flow_branch", schema = "work")
@Data
public class FlowBranch extends FlowMeta{

    @Column(name = "flow_id", columnDefinition = "varchar(36) comment '流程编号'")
    String flowId;

    @Column(name = "source_node_id", columnDefinition = "varchar(36) comment '原始节点编号'")
    String sourceNodeId;

    @Column(name = "target_node_id", columnDefinition = "varchar(36) comment '目标节点编号'")
    String targetNodeId;

    /**
     * 基于选项的条件判断
     */
    @Column(name = "options", columnDefinition = "varchar(20) comment '分支选项'")
    String option;

    /**
     * 基于表达式的条件判断
     */
    @Column(name = "expression", columnDefinition = "varchar(255) comment '条件表达式'")
    String expression;

}
